// ------- PRELOADER -------//
$(window).load(function(){
    $('.preloader').fadeOut("slow"); // set duration in brackets    
});

/* HTML document is loaded. DOM is ready. 
-------------------------------------------*/
$(function(){

   // --------- HIDE MOBILE MENU AFTER CLIKING ON A LINK ------- //
    $('.navbar-collapse a').click(function(){
        $(".navbar-collapse").collapse('hide');
    });

  // --------- PORTFOLIO IMAGE ----- //
  $('#portfolio a').nivoLightbox({
        effect: 'fadeScale',
    });

  // ------- WOW ANIMATED ------ //
  wow = new WOW(
  {
    mobile: false
  });
  wow.init();

  // ------- GOOGLE MAP ----- //
  //loadGoogleMap();

  // ------- JQUERY PARALLAX ---- //
  function initParallax() {
    $('#home').parallax("100%", 0.3);
    $('#team').parallax("100%", 0.3);
    $('#contact').parallax("100%", 0.1);

  }
  initParallax();



$(document).ready(function() {
    $("a").click(function() {
      $(this)
        .addClass(".aa")
        .siblings()
        .removeClass(".aa");
      if (
        location.pathname.replace(/^\//, "") ==
          this.pathname.replace(/^\//, "") &&
        location.hostname == this.hostname
      ) {
        var $target = $(this.hash);
        $target = ($target.length && $target) || $(this.hash.slice(1));
        if ($target.length) {
          var targetOffset = $target.offset().top;
          $("html,body").animate(
            {
              scrollTop: targetOffset
            },
            500
          );
          console.log(targetOffset);
          return false;
        }
      }
    });
  });


$('.ck').mouseover(function(){
	
	$(this).find('.boxBlock').css({'transition':'.6s all','height':'100%','background-color':'rgba(0,0,0,.7)','color':'transparent'})
	$(this).find('.p1').css('display','none')
	$(this).find('.p2').css({'transition':'1s all','display':'block','color':'#fff'})
	
})
$('.ck').mouseout(function(){
	
	$(this).find('.boxBlock').css({'transition':'.6s all','height':'20%','background-color':'rgba(0,0,0,.5)','color':'#fff'})
	$(this).find('.p1').css('display','block')
	$(this).find('.p2').css({'display':'none'})
	
})

});

